package com.PAT.UnSatisfying;

import java.util.*;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: zjz
 * @Date: 2021/11/15/9:18
 * @Description:
 * @Target: 读入一个正整数 n，计算其各位数字之和，用汉语拼音写出和的每一位数字。
 */
public class intCut {
    public static void main(String[] args){
        int count = 0; // 累加
        Scanner input = new Scanner(System.in);
        String inputString = input.next();
        System.out.println(inputString.length());
        System.out.println(inputString.length()/5);
        ArrayList<Integer> list = splitString(inputString);
        for (Integer o : list) {
            count+=Sum(o);
        }
        System.out.println(count);


        System.out.println();
        Stack<Integer> sum = handleSum(count);

        while(sum.iterator().hasNext()){
            if(sum.size()==1){
                System.out.print(handlePara(sum.pop()));
            }else {
                System.out.print(handlePara(sum.pop())+" ");
            }

        }
    }

    // 拆分字符串方法,拆成整数数组
    public static ArrayList<Integer> splitString(String ss){
        int len = ss.length()/5;
        ArrayList<Integer> integers = new ArrayList<>();


        for (int i = 1; i <= len; i++) {
            integers.add(Integer.parseInt(ss.substring((i-1)*5,(i*5))));
        }

        integers.add(Integer.parseInt(ss.substring(len*5,ss.length())));

        return integers;
    }



    // 计算工具,入参N,出参总和
    public static int Sum(int N){
        int sum = 0;

        while(N>0){
            sum+=N%10;
            N=N/10;
        }

       return sum;
    }

    // 将结果转换为栈
    public static Stack handleSum(int sum){
        Stack<Integer> stack = new Stack<>();

        while(sum>0){
            stack.add(sum%10);
            sum=sum/10;
        }

        return stack;
    }



    // 参数处理, 123456789对应拼音
    public  static String handlePara(int N){

        String ss = "?";
        switch (N){
            case 1:  ss = "yi";break;
            case 2:  ss = "er";break;
            case 3:  ss = "san";break;
            case 4:  ss = "si";break;
            case 5:  ss = "wu";break;
            case 6:  ss = "liu";break;
            case 7:  ss = "qi";break;
            case 8:  ss = "ba";break;
            case 9:  ss = "jiu";break;
            case 0:  ss = "ling";break;
        }

        return ss;


    }



}
